#!/bin/sh

VERSION=1

. /usr/share/univention-lib/base.sh
. /usr/share/univention-lib/ldap.sh
. /usr/share/univention-join/joinscripthelper.lib

joinscript_init

SERVICE="Susan Backup"

eval "$(univention-config-registry shell)"

ucs_removeServiceFromLocalhost "${SERVICE}" "$@"

if ucs_isServiceUnused "${SERVICE}" "$@"; then
	# simply remove them all
	univention-directory-manager container/cn remove "$@" --dn "cn=susan,cn=custom attributes,cn=univention,$ldap_base"
fi

joinscript_remove_script_from_status_file univention-susan

exit 0
